<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('task_publish', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('task_id')->index();
            $table->string('platform', 20)->nullable();
            $table->timestamp('created_at')->comment('数据创建时间')->default(DB::raw('CURRENT_TIMESTAMP'));
            $table->dateTime('published_at')->comment('发布时间')->nullable();
            $table->unsignedTinyInteger('status')->default(0)->comment('发布状态：0未发布 1已发布');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('task_publish');
    }
};
